package com.wjh.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.wjh.base.ResponseApiData;
import com.wjh.feign.impl.OrderFeignClientImpl;
import com.wjh.order.dto.OrderDetailDto;
import com.wjh.order.request.UpdateOrderPayStateRequest;

/**
 * 调用订单服务接口
 * 
 * @author wenjianhai
 * @date 2023/6/26
 * @since JDK 17
 */
@FeignClient(name = "order-server", path = "/order/api", fallbackFactory = OrderFeignClientImpl.class)
public interface IOrderFeignClient {
	/**
	 * 查询订单及其详情
	 *
	 * @date 2023-06-26
	 * @param orderGuid 订单Guid
	 * @return ResponseApiData
	 * @since JDK 17
	 * @author wenjianhai
	 */
	@GetMapping("/queryOrderAndDetails/{orderGuid}")
	ResponseApiData<OrderDetailDto> queryOrderAndDetails(@PathVariable(value = "orderGuid") String orderGuid);

	/**
	 * 更新订单的支付状态
	 *
	 * @date 2023-06-29
	 * @param request 请求参数
	 * @return ResponseApiData
	 * @since JDK 17
	 * @author wenjianhai
	 */
	@PostMapping("/update/payState")
	ResponseApiData<?> updatePayState(@RequestBody UpdateOrderPayStateRequest request);
}
